home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / C / COMM.ZIP / COMM.H < prev   
Encoding:
C/C++ Source or Header  |  1990-04-17  |  1.5 KB  |  51 lines

  1. /*
  2.  *    Include file for IBM PC comm.c routines
  3.  */
  4.  
  5. /* Defines */
  6.  
  7. #ifndef NULL
  8. #define    NULL    0
  9. #endif
  10.  
  11. #ifndef TRUE
  12. #define FALSE    0
  13. #define    TRUE    ~FALSE
  14. #endif
  15.  
  16. typedef unsigned char uchar;
  17. typedef unsigned int uint;
  18.  
  19. #define CBS        16384    /* RS-232 input buffer size (a guess) */
  20.  
  21. #define COM1        1    /* port number parameters for comm_open() */
  22. #define COM2        2
  23.  
  24. #define MDMDAT1        0x03F8    /* Address of modem port 1 data */
  25. #define MDMSTS1        0x03FD    /* Address of modem port 1 status  */
  26. #define MDMCOM1        0x03FB    /* Address of modem port 1 command */
  27. #define MDMDAT2        0x02F8    /* Address of modem port 2 data */
  28. #define MDMSTS2        0x02FD    /* Address of modem port 2 status */
  29. #define MDMCOM2        0x02FB    /* Address of modem port 2 command */
  30. #define MDMINTV        0x000C    /* Com 1 interrupt vector */
  31. #define MDINTV2        0x000B    /* Com 2 interrupt vector */
  32.  
  33. #define MDMINTO        0x0EF    /* Mask to enable IRQ3 for port 1 */
  34. #define MDMINTC        0x010    /* Mask to Disable IRQ4 for port 1 */
  35.  
  36. #define MDINTC2        0x008    /* Mask to Disable IRQ3 for port 2 */
  37. #define MDINTO2        0x0F7    /* Mask to enable IRQ4 for port 2 */
  38.  
  39. #define INTCONT        0x0021    /* 8259 interrupt controller ICW2-3 */
  40. #define INTCON1        0x0020    /* Address of 8259 ICW1 */
  41.  
  42. #define XOFF        0x13    /* XON/XOFF */
  43. #define XON        0x11
  44.  
  45. /* Function Prototypes */
  46.  
  47. static void dobaud(uint);
  48. void    comm_close(void), comm_flush(void), comm_putc(uchar);
  49. int    comm_open(int, uint), comm_avail(void), comm_getc(void);
  50. int    dread(uchar *, int, int);
  51.